/**
 * @ClassName StringDemo02
 * @Description 常用方法equals/equalsIgnoreCase
 * @Author Li
 * @Date 2022/8/1 8:53
 * @ModifyDate 2022/8/1 8:53
 * @Version 1.0
 */
public class StringDemo02 {
    public static void main(String[] args) {
        // 创建字符串对象
        String str1 = "Hello";
        String str2 = "Hello";
        String str3 = "hello";

        // public boolean equals(Object obj)：将字符串与指定对象进行比较
        System.out.println(str1.equals(str2)); // true
        System.out.println(str1.equals(str3)); // false

        System.out.println("==============");
        // public boolean equalsIgnoreCase(String anotherString)：将此字符串与指定对象进行比较，忽略大小写
        System.out.println(str1.equalsIgnoreCase(str2)); // true
        System.out.println(str1.equalsIgnoreCase(str3)); // true
    }
}
